Skip to content

Conversation

@compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Aug 14, 2025

r? @estebank

Follow-up to #145401, which was missing some cases. Also change .iter().next() -> .first() when applicable.

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 14, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 14, 2025

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

rustc_errors::emitter was changed

cc @Muscraft

rustc_macros::diagnostics was changed

cc @davidtwco, @compiler-errors, @TaKO8Ki

@estebank
Copy link
Contributor

r=me

@estebank
Copy link
Contributor

also filed rust-lang/rust-clippy#15487

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_codegen_cranelift v0.1.0 (/checkout/compiler/rustc_codegen_cranelift)
error[E0599]: no method named `first` found for struct `SwitchTargetsIter` in the current scope
   --> compiler/rustc_codegen_cranelift/src/base.rs:442:71
    |
442 |                     || (targets.iter().count() == 1 && targets.iter().first().unwrap().0 == 0);
    |                                                                       ^^^^^ method not found in `SwitchTargetsIter<'_>`

error[E0599]: no method named `first` found for struct `SwitchTargetsIter` in the current scope
   --> compiler/rustc_codegen_cranelift/src/base.rs:445:67
    |
445 |                     let (then_value, then_block) = targets.iter().first().unwrap();
    |                                                                   ^^^^^ method not found in `SwitchTargetsIter<'_>`

For more information about this error, try `rustc --explain E0599`.
[RUSTC-TIMING] rustc_codegen_cranelift test:false 1.081
error: could not compile `rustc_codegen_cranelift` (lib) due to 2 previous errors
Build completed unsuccessfully in 0:02:25

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be done in the cg_clif repo instead?

Copy link
Member

@lqd lqd Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjorn3 since these are not slices (and cause the errors on CI), is it worth it to go through the individual values/targets to avoid an iter().next() call? (I guess you could compare the entire values array to a [packed 0u128]).

If so, I'll open a PR to the cg_clif.

@bors
Copy link
Collaborator

bors commented Sep 4, 2025

☔ The latest upstream changes (presumably #146185) made this pull request unmergeable. Please resolve the merge conflicts.

@wesleywiser wesleywiser added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 13, 2025
@compiler-errors
Copy link
Member Author

probably won't land this, too busy with new job

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants